<template>
  <el-dialog v-model="dialogVisible" title="新增资源" width="50%" :before-close="handleClose">
    <el-form ref="InnerResourceFormRef" :model="ruleForm" :rules="rules" label-width="120px" size="large" status-icon>
      <el-form-item label="资源名称">
        <el-input></el-input>
      </el-form-item>
      <el-form-item label="资源创作者">
        <el-input></el-input>
      </el-form-item>
      <el-form-item label="资源描述">
        <el-input type="textarea"></el-input>
      </el-form-item>
      <el-form-item label="所属学科">
        <el-select v-model="ruleForm.region" placeholder="请选择学科">
          <el-option label="工学" value="shanghai" />
          <el-option label="文学" value="beijing" />
        </el-select>
      </el-form-item>
      <el-form-item label="是否显示">
        <el-switch> </el-switch>
      </el-form-item>
      <el-form-item label="关系属性"> </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false"> 保存 </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script setup lang="ts">
import { reactive, onBeforeMount, onMounted, inject } from "vue";
import { ElMessageBox } from "element-plus";
let dialogVisible = inject("isShowAddDialog");
const handleClose = () => {
  // ElMessageBox.confirm("内容未保存，是否确认退出？", "提示").then(() => {
  dialogVisible.value = !dialogVisible.value;
  // });
};
</script>
<style lang="scss" scoped></style>
